package com.momo.hotel.service.impl;

import com.momo.hotel.dao.mapping.TbOrderMapper;
import com.momo.hotel.dao.pojo.TbOrder;
import com.momo.hotel.service.HotelOrderService;
import com.momo.hotel.service.HotelUserLoginService;

import javax.annotation.Resource;
import java.util.List;

public class HotelOrderServiceImpl implements HotelOrderService {
    @Resource
    TbOrderMapper tbOrderMapper;
    @Override
    public int insert(TbOrder tbOrder) {
        return tbOrderMapper.insert(tbOrder);
    }

    /**
     * 需要自定义sql
     * @param tbOrder
     * @return
     */
    @Override
    public int delete(TbOrder tbOrder) {
        Integer id = tbOrder.getId();
//        return tbOrderMapper.updateById();
        return 1;
    }

    @Override
    public int update(TbOrder tbOrder) {
        return tbOrderMapper.updateByPrimaryKey(tbOrder);
    }

    @Override
    public List<TbOrder> selectall() {
        return tbOrderMapper.selectAll();
    }

    @Override
    public List<TbOrder> selectone(TbOrder tbOrder) {
        return tbOrderMapper.select(tbOrder);
    }
}
